<template>
	<view class="toast">
		<view class="msg" :style="`opacity: ${opacity};`" >{{msg}}</view>
	</view>
</template>

<script>
	export default {
		
	    name: 'Toast',
		data(){
			return{
				show:false,
				msg:"",
				opacity:0
			}
		},
	    methods: {
			showToast(msg){
				var that =this
				console.log(msg)
				this.msg=msg
				this.opacity=1
				setTimeout(function() {
					that.opacity=0
				
				}, 1000);
			}
	    }
	  }
</script>

<style>
	.toast{
		position: fixed;
		top: 50%;
		width: 90%;
		height: 240rpx;
		display: flex;
		padding: 40rpx;
		box-sizing: border-box;
		justify-content: center;
	}
	.msg{
		font-size: 40rpx;
		font-weight: 600;
		height: 80rpx;
		padding: 0 20rpx;
		line-height: 80rpx;
		border-radius: 10rpx;
		background-color: white;
		border: 1rpx #F0F0F0 solid;
		transition: all 0.5s;
	}
</style>
